07. Explore 2D Imaging Properties

Explore 2D Imaging Properties

ND320 C2 L2 09 Exploring 2D Imaging Properties Video Pt 1

Note: In the video, it should be my_dicom.pixel_array, not my_dicom.pixel_data.

ND320 C2 L2 10 Exploring 2D Imaging Properties Video Pt 2

Summary

Read DICOM files

The pydicom package allows us to extract all of the metadata from a set of DICOM files and store them in a way that is easy to access.

my_dicom = pydicom.dcmread(“MY_DICOM.dcm”) is used to read a DICOM file.

my_dicom_image = my_dicom.pixel_array is used to access the actual pixel data of the image.

matplotlib.pyplot.imshow(my_dicom_image, cmap = ‘gray’) is used to show the image.

It is worth noting that the data returned in my_dicom.pixel_array will be in the coordinate format [y,x].

Explore image data

A good practice is to perform random spot checks of your data by choosing several random images and visualizing them. Then you can explore images in a pixel level by looking at intensity profiles of individual images.